import methodApi from './methodAPI'
import './methodAPI/getPageMessage'
import './tools/addPageFun'
import './methodAPI/usewatch'


// console.log('content页面更新666')
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
  // console.log(sender.tab ?"from a content script:" + sender.tab.url :"from the extension");
  // if (request.cmd == 'test') alert(request.value);
  // console.log("request,收到背景传递的消息666666")
  if (request.method == 'dly-bgs') {
    let getMeter = methodApi[request.type]
    // console.log('getMeter',getMeter)
    if (getMeter && getMeter.allow && getMeter.exec) {
      getMeter.exec(request, sender, sendResponse)
    }
  }
  // if (request.type_urs === 'tobgwt-coupon') {
  //   console.log('需要保存修改的信息', request)
  // }
  return true
});